
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { CommonEntity } from "./common.entity";
import { User } from './framework/system/SysUser';
import { TeamTeacherEntity } from './teamTeacher.entity';
import { TeacherVolunteerTeamEntity } from './teacherVolunteerTeam.entity';
import { GroupEntity } from './group.entity';
@Entity('teacher', {
	comment: '教师信息表',
	schema: "public"
})
export class TeacherEntity extends CommonEntity {
	@PrimaryGeneratedColumn({ type: 'integer', name: 'teacher_id', comment: '教师ID' })
	teacherId: number;

	@Column({ type: 'integer', name: 'user_id', default: null, comment: '用户ID' })
	userId: number;

	@Column({ type: 'character varying', name: 'teach_id', default: null, comment: '工号' })
	teachId: string;

	@Column({ type: 'character varying', name: 'email', default: null, comment: '邮箱' })
	email: string;

	@Column({ type: 'character varying', name: 'summary', default: null, comment: '个人简介' })
	summary: string;

	@Column({ type: 'character varying', name: 'major_field', default: null, comment: '专业方向' })
	majorField: string;

	@Column({ type: 'character varying', name: 'remark', default: null, comment: '备注' })
	remark: string;

	@Column({ type: 'character', name: 'status', default: '0', comment: '状态（0正常 1停用）' })
	status: string;

	@Column({ type: 'character', name: 'del_flag', default: '0', comment: '删除标志（0代表存在 1代表删除）' })
	delFlag: string;
	@OneToOne(() => User)
	@JoinColumn({ name: 'user_id', referencedColumnName: 'userId' })
	user: User;

	@OneToMany(() => TeamTeacherEntity, (teamTeacher) => teamTeacher.teacher)
	teamTeachers: TeamTeacherEntity[];

	@OneToMany(() => TeacherVolunteerTeamEntity, (teacherVolunteer) => teacherVolunteer.teacher)
	teacherVolunteers: TeacherVolunteerTeamEntity[];

	@OneToMany(() => GroupEntity, (group) => group.teachers)
	groups: GroupEntity[];
}
